package org.springblade.modules.admin.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.modules.admin.entity.BuildingElevatorTemplateRele;
import org.springblade.modules.admin.service.BuildingElevatorTemplateReleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;


/**
 * @Description
 * @Author ysq
 * @Date 2023/2/27
 **/
@RestController
@AllArgsConstructor
@RequestMapping("admin/elevator/template/rele")
@Api(value = "项目电梯关联模板", tags = "项目电梯关联模板接口")
public class BuildingElevatorTemplateReleController extends BladeController {

	private final BuildingElevatorTemplateReleService buildingElevatorTemplateReleService;

	/**
	 * 懒加载列表
	 */
	@GetMapping("/lazy-list")
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "懒加载列表")
	public R<List<BuildingElevatorTemplateRele>> lazyList(@ApiParam(value = "项目id", required = true) @RequestParam Long buildingId,
														  @ApiParam(value = "模板id") @RequestParam(required = false) Long parentId) {
		List<BuildingElevatorTemplateRele> list = buildingElevatorTemplateReleService.lazyList(buildingId, parentId);
		return R.data(list);
	}
}
